package cn.sh.yhk.mapper.basic;

import cn.sh.yhk.model.basic.SUserRegion;
import cn.sh.yhk.model.basic.SUserRegionExample;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

@Mapper
public interface SUserRegionMapper {
    @SelectProvider(type = SUserRegionSqlProvider.class, method = "countByExample")
    long countByExample(SUserRegionExample example);

    @DeleteProvider(type = SUserRegionSqlProvider.class, method = "deleteByExample")
    int deleteByExample(SUserRegionExample example);

    @Insert({
            "insert into s_user_region (id, userId, ",
            "regionId)",
            "values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, ",
            "#{regionid,jdbcType=INTEGER})"
    })
    int insert(SUserRegion record);

    @InsertProvider(type = SUserRegionSqlProvider.class, method = "insertSelective")
    int insertSelective(SUserRegion record);

    @SelectProvider(type = SUserRegionSqlProvider.class, method = "selectByExample")
    @Results({
            @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER),
            @Result(column = "userId", property = "userid", jdbcType = JdbcType.INTEGER),
            @Result(column = "regionId", property = "regionid", jdbcType = JdbcType.INTEGER)
    })
    List<SUserRegion> selectByExample(SUserRegionExample example);

    @UpdateProvider(type = SUserRegionSqlProvider.class, method = "updateByExampleSelective")
    int updateByExampleSelective(@Param("record") SUserRegion record, @Param("example") SUserRegionExample example);

    @UpdateProvider(type = SUserRegionSqlProvider.class, method = "updateByExample")
    int updateByExample(@Param("record") SUserRegion record, @Param("example") SUserRegionExample example);
}